package com.fansl.koala.quickdev.module.koala.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fansl.koala.quickdev.module.koala.entity.UserEverydayStatisticDetail;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author fansl
 * @Description: TODO
 * @date 2020/5/6 11:31
 */
public interface UserEverydayStatisticDetailMapper extends BaseMapper<UserEverydayStatisticDetail> {
    @Select({"<script>select * from ${tableName} where userId = #{userId} and taskType = 'Share' and statisticDate &gt;=#{vipTime} order by statisticDate desc</script>"})
    List<UserEverydayStatisticDetail> getUserVipShareInfo(String tableName, Long userId, LocalDateTime vipTime);

    @Select({"<script>select * from ${tableName} where userId = #{userId} and statisticDate =#{taskDate} order by createTime</script>"})
    List<UserEverydayStatisticDetail> getTaskInfoInDate(String tableName, Long userId, LocalDateTime taskDate);
}
